// 我的消息——准消息

var NSIndex = Vue.component('NSIndex', {
    data() {
        return {
            data: {
                page: { // 分页
                    totalPage: 10, // 数据总页数
                    totalNum: 520, // 数据总条数
                    pageNum: 6 // 数据请求条数
                }
            }
        }
    },

    template: `<div class="order__NSIndex">
                    <div class="table__three">
                        <div class="table__three__list">
                            <table>
                                <tbody>
                                    <tr>
                                        <th>
                                            <span>XXX部门</span>
                                        </th>
                                        <th>
                                            <span>新消息</span>
                                        </th>
                                        <th>
                                            <span>操作</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <span>XXX</span>
                                        </td>
                                        <td>
                                            <span>99</span>
                                        </td>
                                        <td>
                                            <span class="common__see" @click="goDetailFun" data-id="0">查看</span>
                                            <span class="common__see" @click="goReplayFun" data-id="0">回复</span>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <common-page :getPage="data.page" @givePageFun="givePageFun"></common-page>
                </div>`,

    methods: {
        goDetailFun: function (e) { // 详情跳转
            let id = e.target.dataset.id
            let router_click = this.$router.resolve({
                name: 'NSDetail',
                query: {
                    id: id
                }
            })
            window.open(router_click.href, '_blank')
        },
        goReplayFun: function (e) { // 回复跳转
            let id = e.target.dataset.id
            let router_click = this.$router.resolve({
                name: 'NSMsg',
                query: {
                    id: id
                }
            })
            window.open(router_click.href, '_blank')
        },
        givePageFun: function (res) { // 接收分页数据
            console.log(res)
        }
    },

    created() {
        
    },
})